<template>

  <div class="attachment">
    <div class="download-item">
      <a :href="attachment.url|url" :download="attachment.name  +'.' + attachment.extension" target="_blank" class="el-icon-download">下载 {{attachment.name}}.{{attachment.extension}}</a>
    </div>
  </div>


</template>

<script>
export default {
  props: {
    value:{
      type: String|Array
    }
  },
  data() {


    return {
      attachment: null
    };
  },
  watch:{
     value:{
       handler(val){
         this.attachment = (typeof this.value === 'string' ? JSON.parse(this.value || '[]') : this.value) || {}

       },
       immediate: true
     }
  },
  computed: {


  },
  methods: {

  }
};
</script>
<style scoped lang="scss">


</style>
